module.exports = function ($scope, $modalInstance, $resource, $modal, item, toaster){

    $scope.record = item;
    $scope.currentPage = 1;		//当前页码
	$scope.itemsPerPage = 10;	//每页显示几条
    $scope.searchform = {};

    $scope.loadlist = function () {
        var para = {
            'pageNo': $scope.currentPage,
            'pageSize': $scope.itemsPerPage,
            'start_time': $scope.record.date,
            'end_time': $scope.record.date
        }
        $resource('/api/as/puc/citydiscount/findPriceList', {}, {}).save(para, function (res) {
            if (res.errcode === 0) {
				$scope.recordList = res.data.results;
				$scope.totalItems = res.data.totalRecord;
			} else {
				toaster.error({ title: '', body: res.errmsg });
			}
		});
    }
    $scope.loadlist();


    //确认
    $scope.ok = function () {
        $modalInstance.close();
    }
    
    //取消
    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    };

};